# 面向对象

class Student:
    name = 'xx'
    age = 20
    score = 90

    # 构造函数
    def __init__(self, name, age, score):
        self.name = name
        self.age = age
        self.score = score

    def __eat__(self):
        print(self.name + '正在吃')


s1 = Student('小米', 20, 90)
print(s1.name + '年龄' + str(s1.age) + '成绩' + str(s1.score))
s1.__eat__()


# 继承
class Student2(Student):
    def __init__(self, name, age, score, school):
        self.school = school
        super().__init__(name, age, score)


s2 = Student2('小明', 20, 90, '清华大学')
print(s2.name + '年龄' + str(s2.age) + '成绩' + str(s2.score) + '学校' + s2.school)
s2.__eat__()
